package com.haiheng.voiceandbook.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.haiheng.bookmusic.utils.GlideUtils
import com.haiheng.voiceandbook.R
import com.haiheng.voiceandbook.common.BookDto


class BookAdapter(layoutResId: Int, data: List<BookDto>?) :
    BaseQuickAdapter<BookDto, BaseViewHolder>(layoutResId, data) {

    override fun convert(helper: BaseViewHolder?, item: BookDto?) {


        helper?.run {
                    setText(R.id.name, item?.bookName)
                    val imageView = getView<ImageView>(R.id.imageView)
            if (item != null&& item.coverImg!=null) {
                GlideUtils.load(mContext, item.coverImg, imageView)
            }



        }


    }


}